Socket
Socket
Sign inDemoInstall

@bugsnag/node

Package Overview
Dependencies
Maintainers
9
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bugsnag/node

Bugsnag error reporter for Node.js


Version published
Weekly downloads
521K
decreased by-12.54%
Maintainers
9
Weekly downloads
 
Created

What is @bugsnag/node?

@bugsnag/node is a comprehensive error monitoring and reporting tool for Node.js applications. It helps developers detect, diagnose, and resolve errors in real-time, ensuring a smoother user experience and more stable application performance.

What are @bugsnag/node's main functionalities?

Error Reporting

This feature allows you to report errors to Bugsnag. By initializing Bugsnag with your API key and using the `notify` method, you can send error details to the Bugsnag dashboard for further analysis.

const Bugsnag = require('@bugsnag/node');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });

try {
  throw new Error('Something went wrong!');
} catch (e) {
  Bugsnag.notify(e);
}

Breadcrumbs

Breadcrumbs are logs of events that lead up to an error, providing context for debugging. This feature allows you to leave breadcrumbs that will be sent along with error reports.

const Bugsnag = require('@bugsnag/node');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });

Bugsnag.leaveBreadcrumb('User clicked button', { buttonId: 'submit' });

try {
  throw new Error('Something went wrong!');
} catch (e) {
  Bugsnag.notify(e);
}

Custom Metadata

This feature allows you to add custom metadata to your error reports. This can include any additional information that might be useful for debugging, such as user account details or application state.

const Bugsnag = require('@bugsnag/node');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });

try {
  throw new Error('Something went wrong!');
} catch (e) {
  Bugsnag.notify(e, event => {
    event.addMetadata('account', {
      id: 1234,
      name: 'Acme Co'
    });
  });
}

Session Tracking

Session tracking helps you understand the stability of your application from the perspective of your users. By starting a session, you can track errors that occur during that session and get insights into user experience.

const Bugsnag = require('@bugsnag/node');
Bugsnag.start({ apiKey: 'YOUR_API_KEY' });

Bugsnag.startSession();

try {
  throw new Error('Something went wrong!');
} catch (e) {
  Bugsnag.notify(e);
}

Other packages similar to @bugsnag/node

FAQs

Package last updated on 03 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc